{include file="public/header" /}

<body>
  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-col-md12">
        <div class="layui-card">
          <div class="layui-card-body">
            <fieldset id="searchFieldset_currentTableRenderId" class="table-search-fieldset">
              <legend>条件搜索</legend>
              <form class="layui-form layui-form-pane form-search">
                <div class="layui-form-item layui-inline">
                  <label class="layui-form-label">关键字</label>
                  <div class="layui-input-inline">
                    <input type="hidden" name="id" placeholder="账号" value="{:input('get.id')}" autocomplete="off"
                      class="layui-input" />
                    <input type="text" id="dates" name="dates" placeholder="月份" value="{:input('get.dates')}"
                      autocomplete="off" class="layui-input" />
                  </div>
                </div>
                <div class="layui-form-item layui-inline">
                  <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="sreach">
                    搜索
                  </button>
                </div>
              </form>
            </fieldset>
          </div>
          <div class="layui-card-body layui-row layui-col-space10">
            <!-- <button class="layui-btn layui-bg-cyan layui-btn-sm" onclick="open_add('添加用户','user_edit')">
              添加用户
            </button> -->
            <!-- <button class="layui-btn layui-bg-cyan layui-btn-sm" lay-submit="" lay-filter="daochu">
              导出打卡
            </button> -->
            <a title="导出打卡" target="_blank" href="/shop/usersignexcel?id={:input('get.id')}&dates={:input('get.dates')}"
              class="layui-btn layui-btn-sm">
              导出当前督导打卡
            </a>

            共有数据：<strong id="count">{$list->total()}</strong> 条
          </div>
          <div class="layui-table-body layui-table-main">
            <table class="layui-table">
              <thead>
                <tr>
                  <th>
                    <div class="layui-table-cell">ID</div>
                  </th>
                  <th>
                    <div class="layui-table-cell">打卡地址</div>
                  </th>
                  <th>
                    <div class="layui-table-cell">月份</div>
                  </th>
                  <th>
                    <div class="layui-table-cell">日期</div>
                  </th>
                  <th>
                    <div class="layui-table-cell">早上打卡状态</div>
                  </th>
                  <th>
                    <div class="layui-table-cell">早上打卡时间</div>
                  </th>
                  <th>
                    <div class="layui-table-cell">晚上打卡状态</div>
                  </th>
                  <th>
                    <div class="layui-table-cell">晚上打卡时间</div>
                  </th>
                  <th>
                    <div class="layui-table-cell">打卡关联订单</div>
                  </th>
                </tr>
              </thead>
              <tbody>
                {foreach $list as $v}
                <tr>
                  <td>
                    <div class="layui-table-cell">{$v.id}</div>
                  </td>
                  <td>
                    <div class="layui-table-cell">{$v.addresstext}</div>
                  </td>
                  <td>
                    <div class="layui-table-cell">{$v.years}</div>
                  </td>
                  <td>
                    <div class="layui-table-cell">{$v.yearday}</div>
                  </td>
                  <td>
                    <div class="layui-table-cell">{if $v.monstar == 1}未打卡{elseif $v.monstar == 2}正常{else}迟到{/if}</div>
                  </td>
                  <td>
                    <div class="layui-table-cell">{$v.month_time|default="无"}</div>
                  </td>
                  <td>
                    <div class="layui-table-cell">
                      <div class="layui-table-cell">{if $v.aftstar == 1}未打卡{elseif $v.aftstar == 2}正常{else}早退{/if}</div>
                    </div>
                  </td>
                  <td>
                    <div class="layui-table-cell">{$v.after_time|default="无"}</div>
                  </td>
                  <td class="layui-table-col-special">
                    <div class="layui-table-cell">
                      <a title="签到记录" onclick="open_add4('签到记录','/shop/usersigndetail?id={$v.id}')" href="javascript:;"
                        class="layui-btn layui-btn-sm">
                        签到记录
                      </a>
                      {if $v.orderid > 0}
                      <a title="查看任务单" onclick="open_add4('编辑','/shop/shoplist?id={$v.orderid}')" href="javascript:;"
                        class="layui-btn layui-btn-sm">
                        查看任务单
                      </a>
                      {/if}
                    </div>
                  </td>
                </tr>
                {/foreach}
              </tbody>
            </table>
          </div>
          <div class="layui-card-body">
            <div class="page">{$list->render()|raw}</div>
          </div>
        </div>
      </div>
    </div>
  </div>
  {include file="public/footer"}
  <script>
    layui.use(['form', 'layer', 'laydate'], function () {
      $ = layui.jquery;
      var laydate = layui.laydate;
      var form = layui.form
        , layer = layui.layer;
      laydate.render({
        elem: '#dates' //指定元素
        , type: 'month'
      });
    });
  </script>
</body>